<?php
if ($detail_test->num_rows() > 0) {
    $test = $detail_test->row();
}

$pattern = "%d/%m/%Y";
$dob_user = mdate($pattern, $test->dob);

$image_user = './../assets/avatar/images/' . $test->gravatar;
if ($test->gravatar != '') {
    if (file_exists($image_user)) {
        $image_user = root_url('zoo-market') . 'assets/avatar/images/' . $test->gravatar;
    } else {
        $image_user = root_url('zoo-market') . 'assets/noimage.gif';
    }
} else {
    $image_user = root_url('zoo-market') . 'assets/noimage.gif';
}

$image_product = './assets/photos/' . $test->img;
if ($test->img != '') {
    if (file_exists($image_product)) {
        $image_product = base_url() . 'assets/photos/' .$test->img;
    } else {
        $image_product = root_url('zoo-market') . 'assets/noimage.gif';
    }
} else {
    $image_product = root_url('zoo-market') . 'assets/noimage.gif';
}

$gender_user = $test->gender == 'm' ? 'Male' : 'Female';
?>
<div id="wrapper-content">
     <table class="titrepage" width="100%">
        <tr>
            <td >Information échantillon</td>
        </tr>
    </table>

<?php echo form_open(site_url('test/detail_test') . '/' . $test->id); ?>
            <table  width="100%"  class="list">
                <tr>
                    <td align="left" style="color: blue;" colspan="2">Information d'échantillon</td>
                    <td></td>
                </tr>
                <tr>
                    <td><img src="<?php echo $image_product; ?>" width="100px" alt=""/></td>
                    <td align="center"><label for="avatar"></label></td>
                </tr>
                <tr>
                    <td><label for="nomfr">Nom du produit:</label></td>
                    <td><?php echo $test->nomfr; ?></td>
                </tr>
                <tr>
                    <td><label for="nom">Catégorie:</label></td>
                    <td><?php echo $test->nom; ?></td>
                </tr>
                <tr>
                    <td><label for="prix">Prix:</label></td>
                    <td><?php echo $test->prix;  ?></td>
                </tr>
                <tr>
                    <td><label for="descriptionfr">Description:</label></td>
                    <td><?php echo $test->descriptionfr; ?></td>
                </tr>
                <br/>
                <tr>
                    <td align="left" style="color: blue;" colspan="2">Information of user</td>
                    <td></td>
                </tr>
                <tr>

                    <td><img src="<?php echo $image_user; ?>" width="100px" alt=""/></td>
                    <td align="center"><label for="avatar"></label></td>
                </tr>
                <tr>
                    <td><label for="first_name">Nom:</label></td>
                    <td><?php echo $test->first_name; ?></td>
                </tr>
                <tr>
                    <td><label for="last_name">Prénom:</label></td>
                    <td><?php echo $test->last_name; ?></td>
                </tr>
                <tr>
                    <td><label for="DOB">Date de naissance:</label></td>
                    <td><?php echo $dob_user; ?></td>
                </tr>
               
                <tr>
                    <td><label for="phone">Téléphone:</label></td>
                    <td><?php echo $test->phone; ?></td>
                </tr>
                <tr>
                    <td><label for="mobile">Téléphone portable:</label></td>
                    <td><?php echo $test->mobile; ?></td>
                </tr>
                <tr>
                    <td><label for="address">Addresse:</label></td>
                    <td><?php echo $test->address; ?></td>
                </tr>
                <tr>
                    <td><label for="email">Email:</label></td>
                    <td><?php echo $test->email; ?></td>
                </tr>
                <?php if($test->livre==0){?>
                <tr>
                    <td width="70px" colspan="2">
                        <a class="supprimer" href="#" style="color: red">Non encore livrées</a>
                        <div style="display:none">
                                            Confirmer <br/>
                            <a href="<?php echo site_url('test/delivered') . '/' . $test->id.'/'.$test->user_id; ?>"> <img border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/oui.png"/></a>
                            <a class="non" href="#" ><img  border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/non.png"/></a>
                        </div>
                    </td>
                </tr>
                <?php }?>
            </table>
<?php echo form_close(); ?>
</div>